import datetime

def friday_date():
    # 获取当前日期
    today = datetime.datetime.now()

    # 计算今天是周几（Monday=0, Sunday=6）
    today_weekday = today.weekday()

    # 计算到本周五的天数
    friday_weekday = 4  # Friday is the 4th day of the week (0-6 index)
    days_to_friday = (friday_weekday - today_weekday) % 7

    # 计算本周五的日期
    friday = today + datetime.timedelta(days=days_to_friday)

    # 格式化日期为 YYYYMMDD 格式
    friday_date_str = friday.strftime('%Y%m%d')
    
    # 打印并返回格式化的日期字符串
    print(friday_date_str)
    return friday_date_str

# 调用函数
friday_date()